<?php 
    $this->headScript()->appendFile($this->baseUrl() . '/application/modules/Webmix/externals/scripts/webmix.js');
    $this->headScript()->appendFile($this->baseUrl() . '/application/modules/Webmix/externals/scripts/dropdown.js');
?>
<style>
    /*fix site width*/
.layout_page_header .layout_main {
    width: 1000px;
    text-align: right;
    margin: 0px auto 0px auto;
}
.layout_core_menu_main {
    width: 1000px;
    margin: 0px auto 0px auto;
    text-align: left;
    overflow: hidden;
    background-color: #464646;
    background-repeat: repeat-x;
    border: none;
    border-left: none;
    border-right: none;
    -moz-border-radius: 4px;
    -webkit-border-radius: 4px;
    border-radius: 4px;
    -moz-box-shadow: inset 0px 0px 3px rgba(0, 0, 0, .5);
    padding: 1px;
}
#global_content {
    width: 1000px;
    margin: 0px auto 0px auto;
    overflow: hidden;
    min-height: 500px;
}
body {
	margin: 0;
	color: black;
	background-color: white;
	font: 12px/ 20px Arial, Helvetica, sans-serif;
}

.menucontext{
    position: absolute;
    width:222px;
    height:182px;
    
    background: url(<?php echo $this->baseUrl()?>/application/modules/Webmix/externals/images/webmix/menucontext.png) no-repeat;
}
.menucontext_title{
    color: white;
    padding-left: 25px;
    padding-bottom: 5px;;
}
.menucontext_item{
    height: 24px;
    width: auto;
    margin-left: 10px;
    margin-right: 10px;
    padding-left: 15px;
    
}
.menucontext_item:hover{
    background: #4d73b0;
    color:white;
}
.menucontext_close{
    position: absolute;
    top: 0px;
    right: 0px;
    width: 20px;
    height: 20px;
    display: block;
    cursor: pointer;
    line-height: 1.7px;
}
.menucontext_item .menucontext_item_item:hover{
    color:white;
    text-decoration: none;
}
</style>



<h2>
  <?php echo $this->translate("Webmix Plugin") ?>
</h2>

<?php if( count($this->navigation) ): ?>
  <div class='tabs'>
    <?php
      // Render the menu
      //->setUlClass()
      echo $this->navigation()->menu()->setContainer($this->navigation)->render()
    ?>
  </div>
<?php endif; ?>


<div class="menucontext" id="menucontext" style="display:none">
    <ul>
        <li class="menucontext_title"><?php echo $this->translate('Edit Block')?></li>
        <li class="menucontext_item"  ><a  id="menucontext_item_edit_open" href="javascript:void(0);" class="menucontext_item_item open"><?php echo $this->translate('Open Block') ?></a></li>
        <li class="menucontext_item"  ><a  id="menucontext_item_edit_edit" href="javascript:void(0);" class="menucontext_item_item edit smoothbox"><?php echo $this->translate('Edit Block') ?></a></li>
         <li class="menucontext_item"  ><a  id="menucontext_item_edit_company" href="javascript:void(0);" class="menucontext_item_item company smoothbox"><?php echo $this->translate('Edit Company') ?></a></li>
       
       <!-- <li class="menucontext_item"  ><a  id="menucontext_item_edit_copypass" href="javascript:void(0);" class="menucontext_item_item copypass smoothbox"><?php echo $this->translate('Copy/Pass') ?></a></li> -->
        <li class="menucontext_item"  ><a  id="menucontext_item_edit_delete" href="javascript:void(0);" class="menucontext_item_item delete smoothbox"><?php echo $this->translate('Delete') ?></a></li>
      
    </ul>
    <span class="menucontext_close" id="menucontext_close"></span>
</div>
<?php $webmix = $this->webmix;?>
<div class="webmix_tab_command">
    <span class="webmix_tab_command-option" onclick="customShowBox('<?php echo $this->url(array('action'=>'rename','webmix_id'=>$webmix->webmix_id),'webmix_special',true)?>');">
	<?php echo $this->translate('Rename webmix') ?></span>
    
   
</div>
<div class="webmix_view_content">
    
  
       <div class="desktop editable webmix_custom_content_js" id="content-<?php echo $webmix->webmix_id?>"  style="display: block;">
            <div class="grid fix_main_webmix">
                <?php echo $this->partial('webmix_tab.tpl','webmix',array('webmix_id'=>$webmix->webmix_id,'default'=>1,'parent'=>$webmix->parent_id,'type'=>$webmix->type)) ?>
              
            </div>
        </div>
    
</div>
<script type="text/javascript">
    menucontext = new Dropdown($('menucontext'),null,$$('a.smark'),'contextmenu','mouseout',<?php echo $this->viewer->user_id?>,<?php  echo 1?>);
    window.addEventListener('contextmenu',function(e){
       var target = e.target;
       if(!target.hasClass('custommenucontext')){
            e.preventDefault();
             menucontext.hiddenContainer();
       }
    },false);
    window.addEventListener('click',function(e){
       if(menucontext){
            menucontext.hiddenContainer();
       }
             
       
    },false);
    var tab_custom ={};
    tab_custom.current_id = <?php echo $webmix->webmix_id?>;
	webmix_tab_<?php echo $webmix->webmix_id ?>.isadmin = true;
</script>

